home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Jan. 30, 1997
- //
- // Description:
- // This script is for setting prefAngle(a joint command executed).
- //
- // Input Arguments:
- // string showOptionBox true - show the option box dialog
- // false - just execute the command
- //
- // Return Value:
- // None.
- //
-
- if ( !`exists prefAngleSetOptionVars` ) {
- source prefAngleTabBasic;
- }
-
- global proc prefAngleSetCallback( string $parent, int $doIt )
- {
- setParent $parent;
-
- // Set the optionVar's from the control values, and then perform command
- //
- optionVar -intValue recursive
- (`radioButtonGrp -q -sl recursive` - 1);
-
- if( $doIt ) {
- performSetPrefAngle false;
- addToRecentCommandQueue "performSetPrefAngle false" "SetPrefAngle";
- }
- }
-
- proc setPrefAngleOptions()
- {
- string $cmdName = "joint";
- string $funcName = "prefAngle";
- string $callback = ($funcName + "SetCallback");
- string $setup = ($funcName + "Setup");
-
- // Get the option box.
- //
- string $layout = getOptionBox();
-
- // call prefAngleTabBasic to build UI.
- //
- string $parent = `prefAngleTabBasic $layout`;
-
- // Pass the command name to the option box.
- //
- setOptionBoxCommandName($cmdName);
-
- // 'Apply' button.
- //
- string $buttonW = getOptionBoxApplyBtn();
- button -e -l "Set"
- -command ($callback + " " + $parent + " " + 1)
- $buttonW;
-
- // 'Save' button.
- //
- $buttonW = getOptionBoxSaveBtn();
- button -e
- -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox")
- $buttonW;
-
- // 'Reset' button.
- //
- $buttonW = getOptionBoxResetBtn();
- button -e
- -command ($setup + " " + $parent + " " + 1)
- $buttonW;
-
- // Set the option box title.
- //
- setOptionBoxTitle("Set Preferred Angle Options");
-
- // Customize the 'Help' menu item text.
- //
- setOptionBoxHelpTag( "SetPreferredAngle" );
-
- // Call the setup "method" to fill in the current settings
- //
- eval( ($setup + " " + $parent + " " + 0) );
-
- // Show the option box.
- //
- showOptionBox();
- }
-
- proc string setPrefAngleHelp()
- {
- return " Command: set joints preferred angle.\n";
- }
-
- proc string assembleCmd()
- {
- prefAngleSetOptionVars( false );
-
- int $isRecursive = `optionVar -q recursive`;
-
- // execute a joint cmd to set prefAngle.
- // $cmdString is for journaling.
- //
- string $cmdString;
- if ( $isRecursive )
- $cmdString = "joint -e -spa -ch";
- else
- $cmdString = "joint -e -spa";
-
- return $cmdString;
- }
-
- //
- // Procedure Name:
- // performSetPrefAngle
- //
- // Description:
- // Perform the joint command to set joints' preferred angle using the
- // corresponding option values. This procedure will also show the option
- // box window if necessary as well as construct the command string that
- // will invoke the joint command with the current option box values.
- //
- // Input Arguments:
- // 0 - Execute the command.
- // 1 - Show the option box dialog.
- // 2 - Return the command.
- //
- global proc string performSetPrefAngle(int $action )
- {
- string $cmd = "";
-
- switch( $action )
- {
- // Execute the command.
- //
- case 0:
- // Retrieve the option settings
- //
- prefAngleSetOptionVars( false );
-
- $cmd = `assembleCmd`;
- evalEcho($cmd);
- break;
-
- // Show the option box.
- //
- case 1:
- setPrefAngleOptions;
- break;
-
- // Return the command string.
- //
- case 2:
- // Retrieve the option settings.
- //
- prefAngleSetOptionVars( false );
-
- $cmd = `assembleCmd`;
- break;
- }
- return $cmd;
- }
-